#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>
#include<QPropertyAnimation>
#include<QVector>
namespace Ui {
class LrcPage;
}
struct LrcLine
{
    LrcLine(QString &lrcWord,qint64 time)
        :_lrcWord(lrcWord),_time(time)
    {}
    QString _lrcWord;
    qint64 _time;
};

class LrcPage : public QWidget
{
    Q_OBJECT

public:
    explicit LrcPage(QWidget *parent = nullptr);
    ~LrcPage();
    bool parseLrc(const QString&path);

    void showLrcWord(qint64 position);

    int getCurrentIndex(qint64 position);

    QString getLineWord(int index);

private slots:
    void on_hideBtn_clicked();

private:
    Ui::LrcPage *ui;
    QPropertyAnimation*_animation;
    QVector<LrcLine>_lrcLines;
};

#endif // LRCPAGE_H
